<%@ page import="org.qf.pojo.SmbmsUser" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>线上社区超市后台管理系统</title>
    <link rel="stylesheet" href="css/public.css"/>
    <link rel="stylesheet" href="css/style.css"/>
</head>
<body>
<!--头部-->
<header class="publicHeader">
    <h1>线上社区超市后台管理系统</h1>

    <div class="publicHeaderR">
        <p><span>你好！</span><span style="color: #fff21b"> ${sessionScope.userSession.userName}</span> , 欢迎你！</p>
        <a href="login.jsp">退出</a>
    </div>
</header>
<!--时间-->
<section class="publicTime">
    <span id="time">2015年1月1日 11:11  星期一</span>
</section>
<!--主体内容-->
<section class="publicMian ">
    <div class="left">
        <h2 class="leftH2"><span class="span1"></span>功能列表 <span></span></h2>
        <nav>
            <ul class="list">
                <li ><a href="goodsEdit.jsp">商品管理</a></li>
                <li ><a href="billListServlet">订单管理</a></li>
                <li><a href="userServlet">用户管理</a></li>
                <li><a href="password.jsp">密码修改</a></li>
                <li><a href="loginOut">退出系统</a></li>
            </ul>
        </nav>
    </div>
    <div class="right">
        <div class="location">
            <strong>你现在所在的位置是:</strong>
            <span>商品管理页面</span>
        </div>
        <div class="search">
            <form action="goodsServlet" method="get">

                <span>商品类别：</span>
                <select name="classify">
                    <option value="">--请选择--</option>
                    <option value="t_vegetables">蔬菜</option>
                    <option value="t_meat">肉类</option>
                    <option value="t_fruit">水果</option>
                    <option value="t_oil">粮油</option>
                    <option value="t_snacks">零食</option>
                    <option value="t_clothes">衣服</option>
                </select>
                <input type="submit" value="查询"/>
                <a href="goodsAdd.jsp">添加商品</a>
            </form>
        </div>
        <!--用户-->
        <table class="providerTable" cellpadding="0" cellspacing="0">
            <tr class="firstTr">
                <th width="10%">商品编码</th>
                <th width="20%">商品名称</th>
                <th width="15%">商品价格</th>
                <th width="15%">商品售卖</th>
                <th width="10%">商品库存</th>
                <th width="30%">操作</th>
            </tr>
            <c:forEach items="${sessionScope.goods}" var="goods">
                <tr>
                    <td>${goods.id}</td>
                    <td>${goods.name}</td>
                    <td>${goods.price}</td>
                    <td>${goods.sales}</td>
                    <td>${goods.stock}</td>
                    <td>
                        <a href="goodsItemFind?id=${goods.id}&classifyName=${sessionScope.classifyName}"><img src="images/xiugai.png" alt="修改" title="修改"/></a>
                        <a href="javascript:" class="removeUser" onclick="a('${goods.id}','${sessionScope.classifyName}')"><img src="images/schu.png" alt="删除" title="删除"/></a>
                    </td>
                </tr>
            </c:forEach>
        </table>

    </div>

</section>

<!--点击删除按钮后弹出的页面-->
<div class="zhezhao"></div>
<div class="remove" id="removeUse">
    <div class="removerChid">
        <h2>提示</h2>
        <div class="removeMain">
            <p>你确定要删除该商品吗？</p>
            <a href="javascript:" id="yes" onclick="b()">确定</a>
            <a href="#" id="no">取消</a>
        </div>
    </div>
</div>



<script src="js/jquery.js"></script>
<script src="js/js.js"></script>
<script src="js/time.js"></script>
<script type="text/javascript">
    let ids;
    var classifyName;
    function a(id,classify) {
        ids=id;
        classifyName=classify;
    }
    function b() {
        window.location.href="deleteGoodsServlet?id="+ids+"&classify="+classifyName;
    }
</script>
</body>
</html>